﻿//-----------------------------------------------------------------------
// <copyright file="Program.cs" company="DylanBox">
// Copyright (c) DylanBox Corporation. All rights reserved.
// </copyright>
// <summary></summary>
// <reference>
//  Host WCF in Console app 　
//　　1. new a console app;
//　　2. add wcf library as reference to the console app; add System.ServiceModel reference
//　　3. Add a App.Config, fill it with config items in wcf library project;
//         Notes: remove "<host>...</host>" in app.config
//　　4. Code
// </reference>
// <author>Dylan</author>
//-----------------------------------------------------------------------
using System;
using System.ServiceModel;
using WcfLib;

namespace ConsoleHost
{
    class Program
    {
        static void Main(string[] args)
        {
            Uri baseAddress = new Uri("http://localhost:8731/Design_Time_Addresses/WcfLib/DemoService/");

            ServiceHost objServiceHost = new ServiceHost(typeof(DemoService), baseAddress);
            objServiceHost.Open();

            Console.WriteLine("Service Started...");
            Console.Read();
        }
    }
}
